@use 'sass:math'

@function no-unit($value)
  @return math.div($value, ($value * 0 + 1))

@function to-rem($rem, $base-size: $global-font-size)
  $rem: calc(no-unit($rem) / no-unit($base-size) * 1rem)
  @if ($rem == 0rem)
    $rem: 0
  @return $rem

@function rem($values)
  $values-list: length($values)

  @if $values-list == 1
    @return to-rem($values)

  $rem-list: ()

  @for $i from 1 through $values-list
    $rem-list: append($rem-list, to-rem(nth($values, $i)))

  @return $rem-list
